﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using System.ServiceModel;

namespace Sinacor.Servico.Bovespa.Movimento.Service.ServiceImplementation
{
    [ServiceBehavior]
    public class ConsultaAssessor : ServiceContract.IConsultaAssessor
    {
        #region IConsultaAssessor Members

        /// <table>TSCAGENTE, TSCCOMAGE</table>
        public List<DataContract.Response.AgenteResponse> ConsultarAgentes(DataContract.Request.FiltroAgenteRequest request)
        {
            BusinessLogic.ConsultaAssessor blConsultaAssessor = new BusinessLogic.ConsultaAssessor();
            Translator.BusinessEntityToDataContract.ConsultaAssessor translatorResponse = new Translator.BusinessEntityToDataContract.ConsultaAssessor();
            Translator.DataContractToBusinessEntity.ConsultaAssessor translatorRequest = new Translator.DataContractToBusinessEntity.ConsultaAssessor();
            return translatorResponse.ToAgenteResponse(blConsultaAssessor.ConsultarAgentes(translatorRequest.ToFiltroAgente(request)));
        }

        /// <table>TSCASSES</table>
        public List<DataContract.Response.AssessorResponse> ConsultarAssessores()
        {
            BusinessLogic.ConsultaAssessor blConsultaAssessor = new BusinessLogic.ConsultaAssessor();
            Translator.BusinessEntityToDataContract.ConsultaAssessor translatorResponse = new Translator.BusinessEntityToDataContract.ConsultaAssessor();
            return translatorResponse.ToAssessorResponse(blConsultaAssessor.ConsultarAssessores());
        }

        /// <table>TBOCORRESP</table>
        public List<DataContract.Response.CorrespondenteResponse> ConsultarCorrespondentes()
        {
            BusinessLogic.ConsultaAssessor blConsultaAssessor = new BusinessLogic.ConsultaAssessor();
            Translator.BusinessEntityToDataContract.ConsultaAssessor translatorResponse = new Translator.BusinessEntityToDataContract.ConsultaAssessor();
            return translatorResponse.ToCorrespondenteResponse(blConsultaAssessor.ConsultarCorrespondentes());
        }

        /// <table>V_TBOMOVCL</table>
        public List<DataContract.Response.ConsultaAssessorResponse> ConsultarMovimentoAssessores(DataContract.Request.FiltroConsultaAssessorRequest request)
        {
            BusinessLogic.ConsultaAssessor blConsultaAssessor = new BusinessLogic.ConsultaAssessor();
            Translator.BusinessEntityToDataContract.ConsultaAssessor translatorResponse = new Translator.BusinessEntityToDataContract.ConsultaAssessor();
            Translator.DataContractToBusinessEntity.ConsultaAssessor translatorRequest = new Translator.DataContractToBusinessEntity.ConsultaAssessor();
            return translatorResponse.ToConsultaAssessorResponse(blConsultaAssessor.ConsultarMovimentoAssessores(translatorRequest.ToFiltroConsultaAssessor(request)));
        }

        #endregion
    }
}
